﻿using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using Microsoft.Practices.ServiceLocation;

namespace Deixei.Infrastructure
{
    public static class DeixeiContainer
    {
        public static IUnityContainer Container = new UnityContainer();
        public static IServiceLocator Locator = new UnityServiceLocator(Container);


        public static void Registration()
        {
            DeixeiContainer.Container.AddNewExtension<Interception>();
        
        }
        //public static IUnityContainer Container
        //{
        //    get {
        //        IUnityContainer container = HttpContext.Current.Items["Container"] as IUnityContainer;
        //        if ( container == null )
        //        {
        //            container = new UnityContainer();
        //            // TODO: http://unity.codeplex.com/discussions/242485
        //            HttpContext.Current.Items["Container"] = container;
        //        }
        //        return container; }
        //}
        
    }
}
